package com.ruoyi.system.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

@Data
@TableName("tb_category")
public class Category {
    @JsonFormat(shape = JsonFormat.Shape.STRING) // 关键注解
    @TableId(type = IdType.AUTO)
    private Long id;
    private String name;
    @JsonFormat(shape = JsonFormat.Shape.STRING) // 关键注解
    private Long parentId;
    private Integer level;
    private String status;
    private String delFlag;
    private String createBy;

    private LocalDateTime createTime;
    private String updateBy;
    @TableField(fill = FieldFill.INSERT_UPDATE) // 插入和更新时自动填充
    private LocalDateTime updateTime;
    private String remark;
    private Integer surplusCount;
    private Integer surplusSingleCount;
    private String specs;
    private String unit;
    private BigDecimal price;
    private String batchNumber;
    private LocalDateTime effectiveDate;
    private String certificateNumber;
    private String license;
    private String manufacturer;

    @TableField(exist = false)
    private List<Category> children = new ArrayList<>();
}
